#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    int n = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        long x = 0;
        scanf("%ld", &x);
        int left = 3;
        int right = 1000001;
        int k = 3;
        while (left <= right) {
            int mid = left + (right - left) / 2;
            long product = (long)mid * (mid - 1) * (mid - 1);
            if (product >= x) {
                k = mid;
                right = mid - 1;
            }
            else {
                left = mid + 1;
            }
        }
        printf("%d\n", k);
    }
    return 0;
}